<script>
	

    function inittimegrouplist(cmdget) {
        $.ajaxSetup({ cache: false });
        $.get(cmdget, function (data) {
            $('.NBright_TimeGroupList').html(data);

            $('.ajaxbutton11').click(function () {
                var cmd = $(this).attr("cmd");
                $.get(cmd, function (data) {
                    $('.NBright_TimeList').html(data);

					if ($('input[[id*="chkCompleted"]]').is(':checked'))
						$('.hidewhencomplete').hide();			
					else
						$('.hidewhennotcomplete').hide();			

                    $('.ajaxbutton10').click(function () {
                        var cmd = $(this).attr("cmd");
                        $.get(cmd, function (data) {
                            document.location.reload(true);
                        });						
                    });

                });
            });
            
        });
    };

	function isNumber(n) {
        return !isNaN(parseFloat(n)) && isFinite(n);
    }

    $(document).ready(function () {

        $('select[[id*="ddlHours"]]').val('0');
        $('select[[id*="ddlMins"]]').val('0');
        $('input[[id*="txtTimeHours"]]').val('0');

		$.datepicker.setDefaults($.datepicker.regional[['en-GB']]);
        $('input[[name$="txtTimeInpDate"]]').datepicker();
	
        var cmdget = '/desktopmodules/Nbright/NBrightEspace/XmlConnector.ashx?cmd=gettimegrouprep&itemid=[<tag type="valueof" xpath="genxml/hidden/itemid" />]';
        inittimegrouplist(cmdget);


        var totalHours = '[<tag type="valueof" xpath="genxml/hidden/totalhours" />]';
        var hrate = '[<tag type="valueof"  xpath="genxml/hidden/hidallocatedhours" />]';
        if (isNumber(totalHours) && isNumber(hrate)) {
            var hrate2 = parseFloat(hrate);
            var totalHours2 = parseFloat(totalHours);
            if (totalHours2 > hrate2 & hrate2 > 0) {
                $('.hourlyrate').html(' Allocated Hours: ' + '[<tag type="valueof"  xpath="genxml/hidden/hidallocatedhours" />]');
            }
        }

    }); 

	
</script>

<div class="nwb-button-container">
    [<tag id="cmdTimeAddLog" type="linkbutton" resourcekey="general.add" cssclass="nwb-button primary icon add hidewhencomplete" commandname="AddLog" commandargument="ItemID"/>]
[<tag id="ddlTimeEmployee" type="dropdownlist" data="----;{$Employees}" />]
    Hours : 
    [<tag id="ddlHours" cssclass="ddltime" type="dropdownlist" data="0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40" text="0" />]
    :[<tag id="ddlMins" cssclass="ddltime" type="dropdownlist" datavalue="0;25;5;75" data="0;15;30;45" text="0" />]
Date : [<tag id="txtTimeInpDate" datatype="date" type="textbox" width="100" />]
Log : [<tag id="txtTimeLog" type="textbox" width="500" />]
    
</div>
                <hr/>
			    <div class="NBright_TimeGroupList" style="float:left;">
			    </div>
			    <div class="NBright_TimeList" style="float:left;margin-left:50px">
			    </div>			        
                <div style="clear:both;"></div>